{% from "components/macros/layout.html" import card %}
{% from "components/macros/table.html" import data_table %}
{# What a command touched (``SlowQuery.touched``): its key's family, as
the keyspace map names it, and the key; a command without one (KEYS,
INFO) touched none. #}
{% macro touched(q) %}
{%- if q.touched %}{{ q.touched }}{{ q.key }}
{%- else %}-{% endif -%}
{% endmacro %}
{% call card("Slow log", "Slowest first. Yellow from 100ms, red from a second.") %}
{{ data_table([
{"key": "duration", "label": "Duration", "kind": "status"},
{"key": "touched", "label": "Touched", "render": touched},
{"key": "command", "label": "Command", "kind": "code"},
{"key": "when", "label": "When"},
], slow, empty="No slow commands logged") }}
{% endcall %}